//
//  SEGHouseSelectCell.m
//  SEGUhomePropertyBaseService
//
//  Created by 揭婧雯 on 2018/12/12.
//  Copyright © 2018 刘山. All rights reserved.
//

#import "SEGHouseSelectCell.h"

@interface SEGHouseSelectCell()

/**
 控件容器
 */
@property (nonatomic, strong)UIView *bgView;


@end

@implementation SEGHouseSelectCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self setSelectionStyle:UITableViewCellSelectionStyleNone];
        [self setupUI];
    }
    return self;
}

- (void)setupUI
{
    self.backgroundColor = kColor_bg;
    //白色视图
    UIView *view = [[UIView alloc] init];
    view.backgroundColor = kColor_W;
    [self.contentView addSubview:view];
    [view mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView);
        make.right.equalTo(self.contentView);
        make.top.equalTo(self.contentView);
        make.bottom.equalTo(self.contentView);
    }];
    self.bgView = view;
    
    UILabel *lable = [[UILabel alloc] init];
    lable.font = kFont_16;
    lable.textColor = kColor_1;
    [self.bgView addSubview:lable];
    self.nameLabel = lable;
    
    UIImage *image = [UIImage imageWithContentsOfFile:SEGPicName(@"btn_more_gray")];
    UIImageView *iconView = [[UIImageView alloc] initWithImage:image];
    [self.bgView addSubview:iconView];
    [iconView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.bgView).with.offset(-15);
        make.centerY.equalTo(self.bgView);
        make.width.mas_equalTo(image.size.width);
    }];
    
    [lable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.bgView).with.offset(15);
        make.right.equalTo(iconView.mas_left).offset(-10);
        make.centerY.equalTo(self.bgView);
    }];
}

- (void)setHouseInfoText:(NSString *)houseInfoText
{
    _houseInfoText = houseInfoText;
    if (houseInfoText.length > 0) {
        self.nameLabel.text = houseInfoText;
    }
}

@end

